<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
</head>
<body>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap/css/default.css">

<!-- Custom styles for this template -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/dashboard.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/adminnav.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap/css/style.css">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.js"></script>
<script src="${pageContext.request.contextPath}/static/js/functions.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="${pageContext.request.contextPath}/static/css/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/static/css/bootstrap/js/prettify.min.js"></script>
<script src="${pageContext.request.contextPath}/static/css/bootstrap/js/multiselect.min.js"></script>

<c:import url="../common/adminTopNav.jsp"/>

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">

            <c:import url="../common/adminLeftNav.jsp"/>

        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <%--content--%>
            <h2 class="sub-header">管理商品库存</h2>
            <div class="col-sm-6 col-sm-offset-3 col-md-8 col-md-offset-2">
                <div class="table-responsive ">
                    <form class="form" role="form" method="post"
                          action="${pageContext.request.contextPath}/product/updateStore">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th>#</th>
                                <th>商品名称</th>
                                <th>商品尺寸</th>
                                <th>商品颜色</th>
                                <th>商品库存量</th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${pcsList}" var="pcs" varStatus="status">
                                <tr>
                                    <td>${status.count}</td>
                                    <td>${pcs.name}
                                        <input type="hidden" name="ids" value="${pcs.pcsId}">
                                        <input type="hidden" name="pid" value="${pcs.pid}">
                                    </td>
                                    <td>
                                            ${pcs.sizeName}
                                    </td>
                                    <td>
                                            ${pcs.colorName}
                                    </td>
                                    <td><input type="number" name="stores" value="${pcs.store}"></td>
                                </tr>
                            </c:forEach>

                            </tbody>
                        </table>
                        <button type="submit" class="btn btn-primary">更新商品库存</button>
                        <button class="btn btn-primary" id="back" type="button"
                                onclick="javascript:location.href='${pageContext.request.contextPath}/product/storeList'">
                            返回列表
                        </button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<c:import url="../common/adminFooter.jsp"/>

</body>
</html>